package com.shopping_assistant.model;

import java.util.ArrayList;
import java.util.List;

public class SimulatedDataProvider {

	public static void simulateData() {

		ShopController.getInstance().getShops().clear();
		PersonController.getInstance().getPersons().clear();

		List<Offer> shop1Offers = new ArrayList<Offer>();
		List<Offer> shop2Offers = new ArrayList<Offer>();
		List<Offer> shop3Offers = new ArrayList<Offer>();
		List<Offer> shop4Offers = new ArrayList<Offer>();
		List<Offer> shop5Offers = new ArrayList<Offer>();
		List<Offer> shop6Offers = new ArrayList<Offer>();
		
		ShopType type1 = new ShopType("Big store");
		ShopType type2 = new ShopType("Sports shop");
		ShopType type3 = new ShopType("Electronics shop");

		Shop shop1 = new Shop("Foetex", type1, "Finlandsgade 17, Aarhus N",
				"08:00", "21:00", "87393000", "Description of foetex..",
				"http://foetex.dk", shop1Offers, 56.171933, 10.191061);
		Shop shop2 = new Shop("Sportsmaster", type2,
				"Thorvaldsensgade 22, Aarhus C", "08:00", "22:00", "43568811",
				"Description of sportsm..", "http://netto.dk", shop2Offers,
				56.171888, 10.191378);
		Shop shop3 = new Shop("Elgiganten", type3, "Address3, City", "10:00",
				"16:00", "12345678", "Description of shop3..",
				"http://shop3.dk", shop3Offers, 56.171985, 10.190627);
		Shop shop4 = new Shop("ShopName4", type1, "Address4, City", "10:00",
				"16:00", "12345678", "Description of shop4..",
				"http://shop4.dk", shop4Offers, 56.170794, 10.189852);
		Shop shop5 = new Shop("ShopName5", type2, "Address5, City", "10:00",
				"16:00", "12345678", "Description of shop5..",
				"http://shop5.dk", shop5Offers, 56.171069, 10.189959);
		Shop shop6 = new Shop("ShopName6", type3, "Address6, City", "10:00",
				"16:00", "12345678", "Description of shop6..",
				"http://shop6.dk", shop6Offers, 56.171248, 10.190045);

		Offer offer1a = new Offer("Fresh meat - low price!", 1, 99, 299,
				"Friday-Thursday", shop1, 149);
		Offer offer1b = new Offer("Nice price on cheese", 2, 99, 299,
				"Saturday-Sunday", shop1, 82);
		Offer offer2a = new Offer("Good offer on new skis", 3, 2999, 4999,
				"Monday-Sunday", shop2, 38);
		Offer offer2b = new Offer(
				"Get the new Nike running shoes, but be quick!", 4, 599, 899,
				"Saturday-Sunday", shop2, 94);
		Offer offer3a = new Offer("New Samsung HD TV - HALF PRICE!", 5, 4999,
				9999, "Wednesday-Friday", shop3, 316);
		Offer offer3b = new Offer("10% on iPod nano", 6, 2999, 5999,
				"Monday-Friday", shop3, 113);
		Offer offer4a = new Offer("Offer4a", 7, 99, 199, "Friday-Sunday",
				shop4, 30);
		Offer offer4b = new Offer("Offer4b", 8, 99, 199, "Friday-Sunday",
				shop4, 15);
		Offer offer5a = new Offer("Offer5a", 9, 99, 299, "Friday-Sunday",
				shop5, 20);
		Offer offer5b = new Offer("Offer5b", 10, 99, 299, "Friday-Sunday",
				shop5, 25);
		Offer offer6a = new Offer("Offer6a", 11, 99, 399, "Friday-Sunday",
				shop6, 10);
		Offer offer6b = new Offer("Offer6b", 12, 99, 399, "Friday-Sunday",
				shop6, 20);

		shop1Offers.add(offer1a);
		shop1Offers.add(offer1b);
		shop2Offers.add(offer2a);
		shop2Offers.add(offer2b);
		shop3Offers.add(offer3a);
		shop3Offers.add(offer3b);
		shop4Offers.add(offer4a);
		shop4Offers.add(offer4b);
		shop5Offers.add(offer5a);
		shop5Offers.add(offer5b);
		shop6Offers.add(offer6a);
		shop6Offers.add(offer6b);

		ShopController.getInstance().getShops().add(shop1);
		ShopController.getInstance().getShops().add(shop2);
		ShopController.getInstance().getShops().add(shop3);
		ShopController.getInstance().getShops().add(shop4);
		ShopController.getInstance().getShops().add(shop5);
		ShopController.getInstance().getShops().add(shop6);

		Person testUser = new Person("q", "q");

		testUser.addShop(new VisitCounter(testUser, shop1, 190));
		//testUser.addShop(new VisitCounter(testUser, shop2, 119));
		testUser.addShop(new VisitCounter(testUser, shop3, 23));
		testUser.addShop(new VisitCounter(testUser, shop4, 35));
		//testUser.addShop(new VisitCounter(testUser, shop5, 102));
		testUser.addShop(new VisitCounter(testUser, shop6, 56));

		testUser.addOffer(new OfferViewCounter(testUser, offer1a, 15));
		testUser.addOffer(new OfferViewCounter(testUser, offer1b, 13));
		//testUser.addOffer(new OfferViewCounter(testUser, offer2a, 7));
		//testUser.addOffer(new OfferViewCounter(testUser, offer2b, 5));
		testUser.addOffer(new OfferViewCounter(testUser, offer3a, 19));
		testUser.addOffer(new OfferViewCounter(testUser, offer3b, 10));
		testUser.addOffer(new OfferViewCounter(testUser, offer4a, 1));
		testUser.addOffer(new OfferViewCounter(testUser, offer4b, 3));
		//testUser.addOffer(new OfferViewCounter(testUser, offer5a, 5));
		//testUser.addOffer(new OfferViewCounter(testUser, offer5b, 6));
		//testUser.addOffer(new OfferViewCounter(testUser, offer6a, 17));
		testUser.addOffer(new OfferViewCounter(testUser, offer6a, 18));
		
		Person testUser2 = new Person("w", "w");

		testUser2.addShop(new VisitCounter(testUser2, shop1, 190));
		testUser2.addShop(new VisitCounter(testUser2, shop2, 119));
		//testUser2.addShop(new VisitCounter(testUser2, shop3, 23));
		//testUser2.addShop(new VisitCounter(testUser2, shop4, 35));
		testUser2.addShop(new VisitCounter(testUser2, shop5, 102));
		//testUser2.addShop(new VisitCounter(testUser2, shop6, 56));

		testUser2.addOffer(new OfferViewCounter(testUser2, offer1a, 15));
		testUser2.addOffer(new OfferViewCounter(testUser2, offer1b, 13));
		testUser2.addOffer(new OfferViewCounter(testUser2, offer2a, 7));
		testUser2.addOffer(new OfferViewCounter(testUser2, offer2b, 5));
		//testUser2.addOffer(new OfferViewCounter(testUser2, offer3a, 19));
		//testUser2.addOffer(new OfferViewCounter(testUser2, offer3b, 10));
		//testUser2.addOffer(new OfferViewCounter(testUser2, offer4a, 1));
		//testUser2.addOffer(new OfferViewCounter(testUser2, offer4b, 3));
		testUser2.addOffer(new OfferViewCounter(testUser2, offer5a, 5));
		testUser2.addOffer(new OfferViewCounter(testUser2, offer5b, 6));
		//testUser2.addOffer(new OfferViewCounter(testUser2, offer6a, 17));
		//testUser2.addOffer(new OfferViewCounter(testUser2, offer6a, 18));

		PersonController.getInstance().getPersons().add(testUser);
		PersonController.getInstance().getPersons().add(testUser2);
		
	}
}
